package com.yinhai.cfg;

import android.content.Context;
import android.content.SharedPreferences;

public class LoginConfigUtil {

	public static LoginConfig getConfig(Context context) {
		SharedPreferences preferences = context.getSharedPreferences(
				AppConfig.LOGIN_CONFIG, Context.MODE_PRIVATE);
		LoginConfig log = new LoginConfig();
		log.setUsername(preferences.getString("name", ""));
		log.setPassword(preferences.getString("password", ""));
		log.setLoginSuccess(preferences.getBoolean("isLoginSuccess", false));
		log.setImUserName(preferences.getString("im_user_name", ""));
		return log;
	}

}
